<?php
use yii\helpers\Html;
use yii\widgets\linkPager;
?>
<?=Html::cssFile('@web/assets/css/dpl-min.css')?>
<?=Html::cssFile('@web/assets/css/bui-min.css')?>
<?=Html::cssFile('@web/assets/css/main-min.css')?>
<?=Html::cssFile('@web/css/site.css')?>
<?=Html::jsFile('@web/assets/js/jquery-1.8.1.min.js')?>
<?=Html::jsFile('@web/assets/js/bui-min.js')?>
<?=Html::jsFile('@web/assets/js/common/main-min.js')?>
<?=Html::jsFile('@web/assets/js/config-min.js')?>

<div class="contianer">
    <div class="row">
        <div class="col-md-12">
            <div class="main">
                <h1>汽车配件列表</h1>
                <div class="tool">
                    <a class="btn btn-primary btn-sm" href="">添加配件</a>
                </div>
                <table class="table table-hover">
                    <tr>
                        <th>Id</th>
                        <th>名称</th>
                        <th>数量</th>
                        <th>厂家数量</th>
                        <th>价格</th>
                        <th>品牌</th>
                        <th>动作</th>
                    </tr>
                    <?php if(count($parts)>0):?>
                        <?php foreach($parts as $v):?>
                            <tr>
                                <td><?=$v->id?></td>
                                <td><?=$v->title?></b></td>
                                <td><?=$v->part_number?></td>
                                <td><?=$v->manufacturer_number?></td>
                                <td><?=$v->list_price?></td>
                                <td><?=$v->brand_title?></td>
                                <td>
                                    <a href="<?=Yii::$app->urlManager->createUrl('autoparts/autoparts/edit?id='.$v->id)?>">编辑</a>
                                </td>
                            </tr>
                        <?endforeach?>
                    <?else:?>
                        <tr><td colspan="5">暂无消息！</td></tr>
                    <?endif?>
                </table>
                <div class="page">
                    <?= LinkPager::widget(['pagination' => $page]) ?>
                </div>
            </div>
        </div>
    </div>
</div>
